module.exports = function(api) {
  api.cache(true);
  const plugins = [];
  const presets = [];
  if (process.env['NODE_ENV'] === 'testing') {
    // node env
    presets.push([
      '@babel/preset-env',
      {
        targets: {
          node: 'current',
        },
      },
    ]);
  }

  return {
    presets,
    plugins,
  };
};
